package pc29;

import java.util.Scanner;
public class J10Account {
	public static void main(String[] args) {
		
		String aid;
		String dateCreated = "2014-03-20";
		
		int balance;
		double interestRate;
		double getMonthlyInterestRate;
		int withDraw;
		int deposit;
		
		Scanner sc = new Scanner(System.in);

		System.out.println("계좌번호 입력");
		aid = sc.next();
		System.out.println("통장잔액 입력");
		balance = sc.nextInt();
		System.out.println("연간 이자율 입력");
		interestRate = sc.nextDouble();
		System.out.println("얼마 인출");
		withDraw = sc.nextInt();
		System.out.println("얼마 예금");
		deposit = sc.nextInt();
		
		getMonthlyInterestRate = getMonthlyInterestRate(interestRate);
		balance = getbalance(balance,withDraw,deposit);
		
		System.out.println("잔액 : " + balance);
		System.out.println("월간이자율 : " + getMonthlyInterestRate);
		System.out.println("통장개설날짜 : " + dateCreated);
	}
	
	public static double getMonthlyInterestRate(double interestRate){
		double getMonthlyInterestRate;
		getMonthlyInterestRate = interestRate / 12;
		return getMonthlyInterestRate;
		
	}
	public static int getbalance(int balance, int withDraw, int deposit){
		int newbalance;
		newbalance = balance + (deposit - withDraw);
		return newbalance;
		
	}
}
